<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:85:"E:\web-linux-20180129\linux\checkorder\public/../application/order\view\ord\add1.html";i:1530687359;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form method="post" action="<?php echo url('Order/editTest'); ?>" id="addForm">
    <h1>添加订单</h1>
    <div class="wizard-card" data-onValidated="setServerName" data-cardname="name">
        <h3><span>基本信息</span></h3>

        <div class="wizard-input-section">
            <input type="hidden" name="oid" value="15">
            <div class="form-group">
                <label>客户名称</label>
                <input type="text" class="form-control" name="client" id="client" data-validate=""/>
            </div>
            <div class="form-group">
                <label>客户联系方式</label>
                <input type="text" class="form-control" name="client_contacts" id="client_contacts" data-validate=""/>
            </div>
            <div class="form-group">
                <label>下单联系人</label>
                <input type="text" class="form-control" name="order_placer" id="order_placer" data-validate=""/>
            </div>
            <div class="form-group">
                <label>下单联系人电话</label>
                <input type="text" class="form-control" name="placer_phone" id="placer_phone" data-validate=""/>
            </div>
            <div class="form-group">
                <label>国内货运</label>
                <textarea type="text" class="form-control" name="transport" id="transport" data-validate=""></textarea>
            </div>
        </div>

    </div>

    <div class="wizard-card" data-cardname="group">
        <h3><span>表计参数</span></h3>

        <div class="wizard-input-section">
            <div class="form-group">
                <label>基表型号</label>
                <select class="form-control" name="meter_id" id="meter_id" data-validate="">
                    <?php if(is_array($meterTypes) || $meterTypes instanceof \think\Collection): $i = 0; $__LIST__ = $meterTypes;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                    <option value="<?php echo $v['meter_id']; ?>"><?php echo $v['meter_type']; ?></option>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
            <div class="form-group">
                <label>表数量</label>
                <input type="text" class="form-control" name="order_qty" id="order_qty" data-validate=""/>
            </div>
            <div class="form-group">
                <label>电子模块类型</label>
                <select class="form-control" name="model_id" id="model_id" data-validate="">
                    <?php if(is_array($modelTypes) || $modelTypes instanceof \think\Collection): $i = 0; $__LIST__ = $modelTypes;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                    <option value="<?php echo $v['model_id']; ?>"><?php echo $v['model_type']; ?></option>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
            <div class="form-group">
                <label>方案</label>
                <select class="form-control" name="pro_id" id="pro_id" data-validate="">
                    <?php if(is_array($programs) || $programs instanceof \think\Collection): $i = 0; $__LIST__ = $programs;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                    <option value="<?php echo $v['pro_id']; ?>"><?php echo $v['pro_name']; ?></option>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
        </div>
    </div>

    <div class="wizard-card" data-cardname="services">
        <h3><span>配件信息</span></h3>
        <div class="wizard-input-section">
            <div class="form-group">
                <label class="col-md-3 col-sm-3 col-lg-3">配件名称</label>
                <label class="col-md-3 col-sm-3 col-lg-3">是否选择</label>
                <label class="col-md-3 col-sm-3 col-lg-3">是否带表箱</label>
                <label class="col-md-2 col-sm-2 col-lg-2 col-md-offset-1 col-sm-offset-1 col-lg-offset-1">表箱数量</label>
            </div>
        </div>
        <!--树-->
        <?php if(is_array($fittings) || $fittings instanceof \think\Collection): $i = 0; $__LIST__ = $fittings;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
        <div class="wizard-input-section col-sm-12 col-md-12 col-xs-12">
            <div class="form-group">
                <div class="col-md-2 col-sm-2 col-lg-2" id="fid_ad<?php echo $v['fid']; ?>">
                    <input type="checkbox" id="fid<?php echo $v['fid']; ?>" name="fid[<?php echo $v['fid']; ?>]" onchange=changeCheck("<?php echo $v['fid']; ?>")>
                </div>
                <div class="col-md-3 col-sm-3 col-lg-3">
                    <label><?php echo $v['fitting']; ?></label>
                </div>
                <div style="display: none;" class="col-md-2 col-sm-2 col-lg-2" id="fid_num<?php echo $v['fid']; ?>">
                    <input type="text" name="fid_num[<?php echo $v['fid']; ?>]" class="col-md-10 col-sm-10 col-lg-10">
                </div>
                <div class="col-md-3 col-sm-3 col-lg-3" style="display: none;" id="is_metercase_ad<?php echo $v['fid']; ?>">
                    <select name="is_metercase[<?php echo $v['fid']; ?>]" id="is_metercase<?php echo $v['fid']; ?>" onchange=changeCase("<?php echo $v['fid']; ?>")>
                        <option value="0">不带表箱</option>
                        <option value="1">带表箱</option>
                    </select>
                </div>
                <div class="col-md-2 col-sm-2 col-lg-2" id="case_num<?php echo $v['fid']; ?>" style="display: none;">
                    <input type="text" name="case_num[<?php echo $v['fid']; ?>]"class="col-md-10 col-sm-10 col-lg-10">
                </div>

            </div>
        </div>
        <?php endforeach; endif; else: echo "" ;endif; ?>
    </div>

    <div class="wizard-card" data-onload="" data-cardname="location">
        <h3><span>基表参数</span></h3>

        <div class="wizard-input-section">
            <div class="form-group">
                <label>内置止回阀</label>
                <select class="form-control" name="is_valve" id="is_valve" data-validate="">
                    <option value="1">带</option>
                    <option value="0">不带</option>
                </select>
            </div>
            <div class="form-group">
                <label>内置滤网</label>
                <select class="form-control" name="is_sieve" id="is_sieve" data-validate="">
                    <option value="1">带</option>
                    <option value="0">不带</option>
                </select>
            </div>
            <div class="form-group">
                <label>铭牌信息</label>
                <select class="form-control" name="nameplate" id="nameplate" data-validate="">
                    <option value="标准型Laison">标准型Laison</option>
                    <option value="客户化">客户化</option>
                    <option value="空">空</option>
                </select>
            </div>
            <div class="form-group">
                <label>是否带唛头</label>
                <select class="form-control" name="is_mark" id="is_mark" data-validate="">
                    <option value="1">是</option>
                    <option value="0">否</option>
                </select>
            </div>
        </div>
    </div>

    <div class="wizard-card">
        <h3><span>技术参数</span></h3>

        <div class="wizard-input-section">
            <div class="form-group">
                <label>固定/动态信道</label>
                <select class="form-control" name="chain" id="chain" data-validate="">
                    <option value="固定信道">固定信道</option>
                    <option value="动态信道">动态信道</option>
                </select>
            </div>
            <div class="form-group">
                <label>红外开关</label>
                <select class="form-control" name="is_infrade" id="is_infrade" data-validate="">
                    <option value="1">开启</option>
                    <option value="0">关闭</option>
                </select>
            </div>
            <div class="form-group">
                <label>计量模式</label>
                <select class="form-control" name="measure_mode" id="measure_mode" data-validate="">
                    <option value="1">按金额计算</option>
                    <option value="0">按体积计算</option>
                </select>
            </div>
            <div class="form-group">
                <label>报警量</label>
                <input type="text" class="form-control" name="alarm" id="alarm" data-validate=""/>
            </div>
            <div class="form-group">
                <label>透支量</label>
                <input type="text" class="form-control" name="overdraft" id="overdraft" data-validate=""/>
            </div>
            <div class="form-group">
                <label>时区</label>
                <input type="text" class="form-control" name="timezone" id="timezone" data-validate=""/>
            </div>
        </div>
    </div>


    <div class="wizard-card">
        <h3><span>软件信息</span></h3>

        <div class="wizard-input-section">
            <div class="form-group">
                <label>加密方式</label>
                <select class="form-control" name="crypt" id="crypt" data-validate="">
                    <option value="软加密">软加密</option>
                    <option value="硬加密">硬加密</option>
                </select>
            </div>
            <div class="form-group">
                <label>软件版本</label>
                <select class="form-control" name="soft_version" id="soft_version" data-validate="">
                    <option value="B/S">B/S</option>
                    <option value="C/S">C/S</option>
                </select>
            </div>
            <div class="form-group">
                <label>数据库</label>
                <select class="form-control" name="sql_db" id="sql_db" data-validate="">
                    <option value="Access">Access</option>
                    <option value="SQL">SQL</option>
                </select>
            </div>
            <div class="form-group">
                <label>是否需要usbkey</label>
                <select class="form-control" name="is_usbkey" id="is_usbkey" data-validate="">
                    <option value="1">是</option>
                    <option value="0">否</option>
                </select>
            </div>
        </div>
    </div>

    <div class="wizard-card">
        <h3><span>其他信息</span></h3>
        <div class="wizard-input-section">
            <div class="form-group">
                <label>备注</label>
                <input type="text" name="other" class="form-control" data-validate="">
            </div>
        </div>
    </div>
    <div>
        <button type="submit">确定</button>
    </div>

</form>
<script src="__JS__/jquery.js"></script>
<script type="text/javascript">

    var jsonfitting = '<?php echo $jsonfittings; ?>';
    jsonfitting = JSON.parse(jsonfitting)
    //console.log(jsonfitting)
    var fidArr = []
    for(var i=0;i<jsonfitting.length;i++){
        fidArr[i] = jsonfitting[i].fid
    }
    //console.log(fidArr)
    function changeCheck(fid) {

        console.log($('#fid'+fid).prop("checked"))
        if($('#fid'+fid).prop("checked")==true){
            $("#fid_num"+fid).css('display','')
            $("#is_metercase_ad"+fid).css('display','')
            $("input[name='fid["+fid+"]']").val(fid)
            //$('#fid'+fid).val(fid)
        }else{
            $("#fid_num"+fid).css('display','none')
            $("#is_metercase_ad"+fid).css('display','none')
            $("#case_num"+fid).css('display','none')
            $("input[name='fid["+fid+"]']").val('')
        }
        console.log($("input[name='fid["+fid+"]']").val())
    }
    function changeCase(fid) {
        var metercase = $("#is_metercase"+fid).val()
        //console.log(metercase)
        if(metercase == 1){
            $("#case_num"+fid).css('display','')
        }else{
            $("#case_num"+fid).css('display','none')
        }
    }

</script>
</body>
</html>